package com.hontech.bv.model.arm

import com.hontech.bv.conn.ReadFrame
import com.hontech.bv.task.eventBus

object ArmStatus {

    val status = Status()

    fun switchValue() = SwitchValue(status.switchValue.value)

    fun update(frame: ReadFrame) {
        frame.parse(arrayOf(
            status.appVersion,
            status.switchValue,
            status.p1,
            status.p2,
        ))
        eventBus.post(StatusUpdateEvent())
    }
}
